<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Agp\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use APY\DataGridBundle\Grid\Mapping as GRID;

/**
 * Agp\CoreBundle\Entity\EventoTerminalEmpresa
 *
 * @ORM\Table(name="evento_terminal_empresa")
 * @ORM\Entity(repositoryClass="Agp\CoreBundle\Repository\EventoTerminalEmpresaRepository")
 */
class EventoTerminalEmpresa {
    
    /**
     * @var object
     * 
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity="Evento", fetch="LAZY", inversedBy="terminais")
     * @ORM\JoinColumn(name="cod_evento", referencedColumnName="cod_evento", onDelete="Cascade")
     * 
     * 
     */
    protected $evento;
    
    /**
     * @var object
     * 
     * @ORM\Id
     * @ORM\ManyToOne(targetEntity="TerminalEmpresa", fetch="LAZY", inversedBy="eventos")
     * @ORM\JoinColumn(name="cod_terminal_empresa", referencedColumnName="cod_terminal_empresa", onDelete="Cascade")
     * 
     * 
     */
    protected $terminalEmpresa;
    
    const SIT_ATIVO = 'Ativo';
    const SIT_FECHADO = 'Fechado';
    const SIT_HABILITADO = 'Habilitado';
    /**
     * @var string $situacao
     *
     * @ORM\Column(name="situacao", type="string", nullable=false)
     */
    protected $situacao;
    
    /**
     * @var object $atendente
     *
     * @ORM\ManyToOne(targetEntity="Atendente", fetch="LAZY")
     * @ORM\JoinColumn(name="cod_atendente", referencedColumnName="cod_atendente", onDelete="Cascade", nullable=true)
     * @Assert\NotBlank()
     */
    protected $atendente;
    
    /**
     * @var object $layout
     *
     * @ORM\ManyToOne(targetEntity="Layout", fetch="LAZY")
     * @ORM\JoinColumn(name="cod_layout", referencedColumnName="cod_layout", onDelete="Cascade", nullable=true)
     */
    protected $layout;
    
    public function __toString() {
        return $this->terminalEmpresa->getTerminal()->getCodTerminal();
    }

    public function __construct() {
        $this->situacao = self::SIT_ATIVO;
    }

    public function getEvento() {
        return $this->evento;
    }

    public function setEvento($evento) {
        $this->evento = $evento;
    }

    public function getTerminalEmpresa() {
        return $this->terminalEmpresa;
    }

    public function setTerminalEmpresa($terminalEmpresa) {
        $this->terminalEmpresa = $terminalEmpresa;
    }
    
    public function getSituacao() {
        return $this->situacao;
    }

    public function setSituacao($situacao) {
        $this->situacao = $situacao;
    }
    
    public function getAtendente() {
        return $this->atendente;
    }

    public function setAtendente($atendente) {
        $this->atendente = $atendente;
    }

    public function getLayout() {
        return $this->layout;
    }

    public function setLayout($layout) {
        $this->layout = $layout;
    }

}

?>
